package com.nbc.car.biz.enums;

/**
 * Created by nipin on 16/7/23.
 */
public enum UserBizEnum {
    SUCCESS(0,"操作成功"),
    REGISTER_FAIL(100001,"账号注册失败"),
    LOGIN_FAIL(100002,"账户或密码错误"),
    SYSTEM_ERROR(100005,"系统异常");

    private  Integer state;
    private  String stateInfo;

    private UserBizEnum(Integer state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public Integer getState() {
        return state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public static UserBizEnum stateOf(int index){
        for(UserBizEnum state:values()){
            if (state.getState() == index){
                return state;
            }
        }
        return null;
    }
}
